<%@ page language="java" pageEncoding="UTF-8"%>
<%@ page import="java.util.*" %> 
<%@ page import="cn.ac.cintcm.dataconverge.util.Constants,cn.ac.cintcm.dataconverge.researcher.domain.*"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";

 
String userName = (String)request.getAttribute("userName")==null?"":(String)request.getAttribute("userName");
String idcard = (String)request.getAttribute("idcard")==null?"":(String)request.getAttribute("idcard");;
String msg = (String)request.getAttribute("msg")==null?"":(String)request.getAttribute("msg");
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
  <head>    
    <title><%=Constants.APP_TITLE %>--用户注册</title>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     <link href="<%=basePath%>index/Themes/com/style.css" rel="stylesheet" type="text/css" />
    <script src="<%=basePath%>index/Scripts/Script.js" language="javascript" type="text/javascript"></script>
    <script language="javascript" type="text/javascript" src="<%=path %>/js/My97DatePicker/WdatePicker.js"></script>
    <script language="javascript" src="<%=path %>/js/common.js"></script>
      <script language="javascript" src="<%=path %>/js/check.js"></script>
    <script src='<%=basePath%>dwr/engine.js'></script>
     <script src='<%=basePath%>dwr/util.js'></script>  
    <script language="JavaScript" type="text/JavaScript">
      function checkUserAcc(){ 
          var userId = dwr.util.getValue("id");
          if(isNull(userId)){
          		alert("请输入登陆帐号");
          		form1.id.focus();
          		return;
          }
          if(!checkName(userId)){
             alert("登陆的帐号须为数字、字母和下划线的组合!");
             form1.id.focus();
          	 return;
          } 
          subject.checkUserId(userId,callBackForCheckId);
      }
      var flag = true;
      function callBackForCheckId(message){
      	  if("0" != message){
      	    if("1" == message)
      	       alert("此帐号可以使用");
      	    if("2" == message){
      	       alert("此帐号已存在，不可注册");
      	       flag = false;
      	    }
      	  }
      }
      function callBackForCheckId1(message){
      	  if("0" != message){ 
      	    if("2" == message){ 
      	       flag = false;
      	    }
      	  }
      }
      function changeGraduateInfo(){
	      	var graduateInfo=document.getElementById("graduateInfo").value;
	      	if(graduateInfo=="不是在读研究生"){
	      		document.getElementById("admissionTime").style.display="none";
	      	}
	      	else{
	      		document.getElementById("admissionTime").style.display="block";
	      	}
      } 
      function changeOrg(){
         var orgId = dwr.util.getValue("org");
         if(orgId != "0"){
            dwr.util.removeAllOptions("department");
            subject.getDeptList(orgId,callBackForChange);
         }
      
      }
      function callBackForChange(dataStr){
         if(''!= dataStr){ 
          	dwr.util.addOptions("department", eval(dataStr),'id','name');  
         }  
      }
      function submitForm(){
           
          var userName = dwr.util.getValue("userName");
          var idcard = dwr.util.getValue("idcard");
          if(isNull(userName)){
          		alert("请输入姓名");
          		form1.userName.focus();
          		return;
          }
          if(isNull(idcard)){
          		alert("请输入身份证号");
          		form1.idcard.focus();
          		return;
          }
          if(!CheckValue(idcard)){ 
          		form1.idcard.focus();
          		return; 
          } 
          form1.submit();
      }
    
      // alert("id须为数字、字母和下划线的组合!"); 
    </script>
  </head>
 
<body  class="idt_body" > 
  <form method="post" name="form1" action="register.htm?action=registerFirst"  >
  <table cellpadding="0" cellspacing="0" width="100%" height="100%" id="Table8">
  
        <tr>
            <td  valign="top" height="100%"> 
                            <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" id="Table11">
                                <tr  id="ldTR">
                                    <td  valign="top">
                                        <!------------------ 标题栏 ------------------>
                                        <!--- 标题 ---->
                                        <table class="idt_tle_mg" cellspacing="0" cellpadding="0" width="100%">
                                            <tr  >
                                                <td class="idt_tle_i">
                                                    <img id="imgForm6" src="<%=basePath%>index/Themes/com/idt_tle_o.gif"></td>
                                                <td class="idt_tle_f1">用户注册</td>
                                            </tr>
                                        </table>
      <div id="tdForm1">
             <table class="idt_fim_mg" cellspacing="1" cellpadding="0" width="100%" id="">
                 <tr id="tab1">
                     <td>
	   					<fieldset align="center">
			                <legend class="com_legend">请输入姓名和身份证号 </legend>
			                <div id="Tr1" class="content"><font color="red"><%=msg %></font>&nbsp;</div>
							<table  border="0" cellpadding="0" cellspacing="1" width="100%" class="com_fieldset_tab">
							   <tr>
							      <td class="fim_l" width="15%">姓名</td>
							      <td class="fim_r"  >
							      <input class="com_textbox" type="text" name="userName" style="width:95%" value="<%=userName %>" value="<%=request.getAttribute("userId")==null?"":request.getAttribute("userId") %>"/>
							      <font color="red">*</font>
							      </td>
							      
							    </tr>
							    <tr>
							      <td class="fim_l" width="20%">身份证号</td>
							      <td class="fim_r"  >
							      <input class="com_textbox" style="width:95%" type="text" value="<%=idcard %>" name="idcard" maxlength="25" ><font color="red">*</font>
							    </tr>
							     
							</table>
     					</fieldset>
				   </td>
				  </tr>
  </table>
   <table cellspacing="0" cellpadding="0" width="100%" class="idt_bottom_mg" border="0">
        <tr>
            <td align="right">
                <input  class="com_btn2" id="Button1" name="save" type="button" onclick="submitForm();" value="提交" >&nbsp;&nbsp;&nbsp;&nbsp;
               <input type="button" value="取消" name="B4" class="com_btn2" id="Button2" onclick="javascript:window.close();">
            </td>
        </tr>
    </table>             
      </table>
            </td>
        </tr>
    </table></form>
  </body>
</html>
